﻿using System.Windows;
using System.Windows.Controls;
using System.Windows.Input;

namespace Vision
{
    public partial class Styles : ResourceDictionary
    {
        public Styles()
        {
            InitializeComponent();
        }

        /// <summary>
        /// 模块标签拖拽处理
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void Label_MouseDown(object sender, MouseButtonEventArgs e)
        {
            if (e.LeftButton == MouseButtonState.Pressed)
            {
                Label lbl = sender as Label;
                // 设置当前被点击的工具上的鼠标样式
                if (lbl != null)
                {
                    // 创建 DataObject 并指定数据格式和数据
                    DataObject dataObject = new DataObject("Label", lbl);
                    DragDrop.DoDragDrop(lbl, dataObject, DragDropEffects.Copy | DragDropEffects.Move);
                }
            }
        }
    }
}
